package cn.swunet.bean;

public class User {
	private int id;
	private String username;
	private String passwd;
	private String activeIp;
	private int activePort;
	private int lastActive;
	
	
	public int getLastActive() {
		return lastActive;
	}
	public void setLastActive(int lastActive) {
		this.lastActive = lastActive;
	}
	//Getter & Setter
	public String getActiveIp() {
		return activeIp;
	}
	public void setActiveIp(String activeIp) {
		this.activeIp = activeIp;
	}
	public int getActivePort() {
		return activePort;
	}
	public void setActivePort(int activePort) {
		this.activePort = activePort;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPasswd() {
		return passwd;
	}
	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}

	
	public User(int id, String username, String passwd, String activeIp, int activePort) {
		this.id = id;
		this.username = username;
		this.passwd = passwd;
		this.activeIp = activeIp;
		this.activePort = activePort;
	}
	
	@Override
	public String toString() {
		return "User [id=" + id + ", username=" + username + ", passwd=" + passwd + ", activeIp=" + activeIp
				+ ", activePort=" + activePort + ", lastActive=" + lastActive + "]";
	}
	
	public String getInfo() {
		return "user_id:"+id+"\r\nuser_name:"+username+"\r\n";
	}
	
	public User(int id, String username, String passwd, String activeIp, int activePort, int lastActive) {
		super();
		this.id = id;
		this.username = username;
		this.passwd = passwd;
		this.activeIp = activeIp;
		this.activePort = activePort;
		this.lastActive = lastActive;
	}
	
	public User(String username, String passwd) {
		super();
		this.username = username;
		this.passwd = passwd;
	}
	public User() {}
}
